package demo.mappers;

import demo.entity.employees;
import demo.entity.record;
import org.springframework.jdbc.core.RowMapper;



import java.sql.ResultSet;
import java.sql.SQLException;

public class empRowMapper implements RowMapper<employees> {

    @Override
    public employees mapRow(ResultSet rs,int i) throws SQLException {
        employees empl = new employees();
        empl.setEmp_id(rs.getInt("emp_id"));
        empl.setName(rs.getString("name"));
        empl.setDepartment_id(rs.getString("department_id"));
        empl.setJob_id(rs.getString("job_id"));
        empl.setBasic_Salary(rs.getInt("basic_salary"));
        empl.setArrival_time(rs.getString("arrival_time"));
        empl.setDeparture_time(rs.getString("departure_time"));;
        empl.setRest_holiday(rs.getInt("rest_holiday"));
        empl.setMonthly_salary(rs.getInt("monthly_salary"));
        return empl;
    }
}
